www.gusucode.com > 深度学习(asp)网址导航 v4.0.1 > 深度学习(asp)网址导航 v4.0.1\code\admin\aspToHtml\aspToHtml_createHTML_index.asp
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%> <% projectRootPath = "../../" '相对当前应用程序根的位置 %> <!-- #include file ="../include/checkPurview.asp"--> <!--#include file="../../ConnDB.asp"--> <!--#include file="../../include/Function.Common.asp"--> <!-- #include file="../include/Function.Manage.Config.asp"--> <!--#include file="../../include/Deep.Class.Template.asp"--> <!--#include file="../../include/function.tag.template.asp"--> <!--#include file="../../include/function.tag.url.asp"--> <!--#include file="../../include/function.tag.common.asp"--> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta name="robots" content="noindex,nofollow" /> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>aspToHtml管理</title> <link href="../themes/<%=theme_Path%>/main.css" rel="stylesheet" type="text/css" /> </head> <body id="bodyBg1"> <br /> <a href="aspToHtml_Manage.asp">生成html管理</a> <hr color="#0099FF" size="1" /> <br /> <dl class="manageContent"> <dt>生成html管理</dt> <dd> <br /> <% 'templateProjectID=Request.QueryString("templateProjectID") 'templateType=Request.QueryString("templateType") ' 1 从Template表中取得模板代码 'strTemplate = getTemplate( templateProjectID , templateType , null) 'strHtml = strTemplate projectRoot2htmlPath="../" 'html文件相对项目位置 isCreateHTML=true '提供标签函数 生成静态页判断 true 生成静态页操作 Dim strHtml:strHtml="" 'response.write "========test============" dim oDeepTemplate set oDeepTemplate=new Deep_Template oDeepTemplate.templates_dir=projectRootPath & "themes/"&site_theme&"/" 'template=oDeepTemplate.readTemplateFile("index.htm") oDeepTemplate.readTemplateFile("index.template.html") '调入文件 'response.Write(oDeepTemplate.template) 'template=replace(template,"../base.css","themes/base.css") 'template=replace(template,"theme.css","themes/"&site_skin&"/theme.css") 'oDeepTemplate.replaceTag "../base.css","themes/base.css" oDeepTemplate.replaceText "theme.css",projectRoot2htmlPath&"themes/"&site_theme&"/theme.css" oDeepTemplate.replaceText "js/siteState.asp",projectRoot2htmlPath&"js/siteState.asp" do_replace_siteConfig(oDeepTemplate) '替换网站基本配置信息标签 ' 2 将模板中的{$ }括起来的标签替换成相应的 数据 , '导航 call do_replace_Channel() '广告 call do_replace_AD() 'response.Write( oDeepTemplate.template ) oDeepTemplate.replaceTag "custom_sort_url",getHTML_custom_sort_url ' 参数 {$fastLogin(46,8)} oDeepTemplate.replaceTagParameter "fastLogin","getHTML_fastLogin" oDeepTemplate.replaceTag "urlSort",getHTML_urlSort oDeepTemplate.replaceTagParameter "urlCool","getHTML_urlCool" 'oDeepTemplate.replaceTag "article_new_tip",getHTML_article_new_tip(10,"article/") 'oDeepTemplate.replaceTag "article_sideBar",getHTML_articleList(2,8,"article/") 'oDeepTemplate.replaceTag "article_elite",getHTML_article_elite(10,"article/") 'oDeepTemplate.replaceTag "index_articleClassView",getHTML_index_articleClassView(0,10,"article/","span-6",3) 'oDeepTemplate.replaceTag "index_middle_1(3,5)",getHTML_index_middle(3,5,"span-18","span-9",0,2) 'oDeepTemplate.replaceTag "index_middle_2(4,5)",getHTML_index_middle(4,5,"span-24","span-6",1,4) 'oDeepTemplate.replaceTag "index_middle_3(5,5)",getHTML_index_middle(5,5,"span-18","span-9",2,2) 'oDeepTemplate.replaceTag "getHTML_index_soft",getHTML_index_soft(0,5,"span-18","span-9",1,2) 'oDeepTemplate.replaceTag "index_Photo",getHTML_index_photo() oDeepTemplate.replaceTag "friendLink",getHTML_friendLink oDeepTemplate.replaceTag "siteInfoStatistic",getHTML_siteInfoStatistic 'oDeepTemplate.display() '显示 strHtml=oDeepTemplate.template set oDeepTemplate=Nothing ' 3 FSO生成HTML文件 '建立目录名,生成的文件将按存放在此处 HtmlDir ="../../html/" fileName="index.htm" tmpFileName = HtmlDir & fileName set fso = server.createobject("Scripting.FileSystemObject") Set fout = fso.CreateTextFile( Server.MapPath(tmpFileName) ) fout.WriteLine strHtml fout.close() set fout=nothing set fso=nothing response.write "首页生成静态页成功! ("&tmpFileName&")<br />" call CloseConnDB() %> <br /> </dd> </dl> <br /> </body> </html>